# -*- coding: UTF-8 -*-
'''
Created on 16/10/2014

@author: Eduardo Cardeira - Num 6033

Exemplo 7 da Aula Teorica 4

'''
import pickle
class Teste:
    def __init__(self, x):
        self.x = x

obj = Teste(49)
f = open("teste.dat", "w")
p = pickle.dump(obj, f)
f.close()
del obj
obj = pickle.load(open("teste.dat", "r"))
print obj.x
